glsl: tweak pre-processor to support Apple GLSL compiler
authorChristian Hergert <chergert@redhat.com>
Thu, 29 Oct 2020 16:37:33 +0000 (09:37 -0700)
committerChristian Hergert <chergert@redhat.com>
Thu, 29 Oct 2020 17:57:02 +0000 (10:57 -0700)
The Apple GLSL compiler cannot deal with empty pre-processor blocks such as

  #if GSK_GLES
  #elif GSK_LEGACY

gsk/resources/glsl/preamble.fs.glsl

index 85b11c013e60505cdba7a179ce2514d5b2a0f52f..c2cd1cdc29ccab5cfd14356cea58e0898055670b 100644 (file)
@@ -5,10 +5,9 @@ uniform float u_alpha;// = 1.0;
 uniform vec4 u_viewport;
 uniform vec4[3] u_clip_rect;
 
-#if GSK_GLES
-#elif GSK_LEGACY
+#if defined(GSK_LEGACY)
 _OUT_ vec4 outputColor;
-#else
+#elif !defined(GSK_GLES)
 _OUT_ vec4 outputColor;
 #endif